From: Giovanni Campagna Date: Mon, 17 Oct 2011 13:18:25 +0000 (+0200) Subject: IMStatusChooserItem: clean up signal handlers on destroy() X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~7402 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=615723d8df61ea261f278441904c7ba97fd9baff;p=gnome-shell.git IMStatusChooserItem: clean up signal handlers on destroy() Extensions (like alternative-status-menu) expect that calling destroy() on a menu item will not leave signal handlers around. https://bugzilla.gnome.org/show_bug.cgi?id=660520 --- diff --git a/js/ui/userMenu.js b/js/ui/userMenu.js index 311ba73e6..d2b0ea37e 100644 --- a/js/ui/userMenu.js +++ b/js/ui/userMenu.js @@ -199,6 +199,21 @@ IMStatusChooserItem.prototype = { })); }, + destroy: function() { + // clean up signal handlers + if (this._userLoadedId != 0) { + this._user.disconnect(this._userLoadedId); + this._userLoadedId = 0; + } + + if (this._userChangedId != 0) { + this._user.disconnect(this._userChangedId); + this._userChangedId = 0; + } + + PopupMenu.PopupBaseMenuItem.prototype.destroy.call(this); + }, + // Override getColumnWidths()/setColumnWidths() to make the item // independent from the overall column layout of the menu getColumnWidths: function() {